home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / src / adoc_src.lha / adoc-0.17 / Makefile < prev    next >
Encoding:
Makefile  |  1995-03-21  |  1.8 KB  |  80 lines

  1. # ADOC -*- Makefile -*- for the GNU C/C++ Compiler on unix systems
  2. #
  3. # (c)Copyright 1995 by Tobias Ferber.
  4. #
  5. # This file is part of ADOC.
  6. #
  7. # ADOC is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation; either version 1 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # ADOC is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with ADOC; see the file COPYING.  If not, write to
  19. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. CC= gcc
  22. CFLAGS= -O3
  23. #CFLAGS= -ggdb -Wall -DDEBUG
  24.  
  25. RM= rm -f
  26.  
  27. srcs = main.c args.c lex.yy.c libfun.c gencode.c strarg.c strexpand.c mactab.c flist.c
  28. #srcs = main.c args.c lex.yy.c libfun.c gencode.c strarg.c strexpand.c mactab.c flist.c debug.c smartmem.c timer.c
  29. objs = $(srcs:.c=.o)
  30. libs = -lfl
  31. prog = adoc
  32.  
  33.  
  34. .PHONY: all
  35.  
  36. all: $(prog)
  37.  
  38. $(prog): $(objs)
  39.     $(CC) $(CFLAGS) -o $@ $(objs) $(libs)
  40.  
  41. lex.yy.c: adoc.yy
  42.     flex -8 -f adoc.yy
  43.  
  44. .c.o:
  45.     $(CC) $(CFLAGS) -c -o $@ $<
  46.  
  47.  
  48. #HOME = devel:gmd/HOME
  49. #REX = $(HOME)/bin/rex
  50. #LIBDIR= -L $(HOME)/lib
  51. #INCDIR= -I $(HOME)/lib/include
  52. #
  53. #a.out: libfun.o
  54. #    $(REX) -c -s -d -g adoc.rex
  55. #    $(CC) $(CFLAGS) $(INCDIR) -c *.c
  56. #    $(CC) $(CFLAGS) $(LIBDIR) *.o -lreuse
  57.  
  58.  
  59. .PHONY: clean
  60.  
  61. clean:
  62. ifneq ($(strip $(wildcard $(prog) $(objs) lex.yy.c .depend core*)),)
  63.     $(RM) $(wildcard $(prog) $(objs) lex.yy.c .depend core*)
  64. endif
  65.  
  66.  
  67. .PHONY: depend
  68.  
  69. depend: .depend
  70.  
  71. .depend:
  72.     $(CC) $(CFLAGS) $(INCDIR) -MM *.c > .depend
  73.  
  74.  
  75. # include the dependency file (if it exists)
  76.  
  77. ifeq (.depend,$(wildcard .depend))
  78. include .depend
  79. endif
  80.